package com.iplant.basic.service.po.sfc;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.annotation.po.DBBasePO;

import java.io.Serializable;

/**
 * 文件管理
 *
 * @author YouWang·Peng
 * 2024-04-28 14:01:05
 */
@DBBasePO(TableName = "sfc_file", CheckName = {"Code", "Name,FileClassification,FileType"}, Schemas = DBSchemas.MES,
        CodeAuto = true, CodePrefix = "SF-{yyMMdd}-", CodeNum = 4,Cache = true)
public class SFCFile extends BasePO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 文件绝对路径
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String FilePath = "";

    /**
     * 文件网络路径
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String FileUrl = "";

    /**
     * 文件类型, 如txt, docx, pdf
     */
    @DBCondition
    @DBField
    public String FileType = "";

    /**
     * 文件大小, 单位字节
     */
    @DBField
    public long FileSize = 0;

    /**
     * 文件分类枚举
     */
    @DBCondition
    @DBField
    public int FileClassification = 0;

    /**
     * 产品ID
     */
    @DBCondition
    @DBField
    public int ProductID = 0;

    /**
     * 产品名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "fpc_product", tableAsName = "fpc_product1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public String ProductName = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Code", tableName = "fpc_product", tableAsName = "fpc_product1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public String ProductCode = "";

    /**
     * 工序名称（分组用）
     */
    @DBCondition
    @DBField
    public String PartPointName = "";

    @JsonProperty("FilePath")
    public String getFilePath() {
        return FilePath;
    }

    public void setFilePath(String filePath) {
        FilePath = filePath;
    }

    @JsonProperty("FileUrl")
    public String getFileUrl() {
        return FileUrl;
    }

    public void setFileUrl(String fileUrl) {
        FileUrl = fileUrl;
    }

    @JsonProperty("FileType")
    public String getFileType() {
        return FileType;
    }

    public void setFileType(String fileType) {
        FileType = fileType;
    }

    @JsonProperty("FileSize")
    public long getFileSize() {
        return FileSize;
    }

    public void setFileSize(long fileSize) {
        FileSize = fileSize;
    }

    @JsonProperty("FileClassification")
    public int getFileClassification() {
        return FileClassification;
    }

    public void setFileClassification(int fileClassification) {
        FileClassification = fileClassification;
    }

    @JsonProperty("ProductID")
    public int getProductID() {
        return ProductID;
    }

    public void setProductID(int productID) {
        ProductID = productID;
    }

    @JsonProperty("ProductName")
    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String productName) {
        ProductName = productName;
    }

    @JsonProperty("ProductCode")
    public String getProductCode() {
        return ProductCode;
    }

    public void setProductCode(String productCode) {
        ProductCode = productCode;
    }

    @JsonProperty("PartPointName")
    public String getPartPointName() {
        return PartPointName;
    }

    public void setPartPointName(String partPointName) {
        PartPointName = partPointName;
    }
}
